

package com.maoshi.shop.distribution.comment.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.maoshi.shop.bean.param.OfflineHandleEventAuditParam;
import com.maoshi.shop.distribution.comment.model.DistributionUser;
import com.maoshi.shop.distribution.comment.po.DistributionProdPO;
import com.maoshi.shop.distribution.comment.dto.DistributionProdDto;
import com.maoshi.shop.distribution.comment.model.DistributionProd;
import com.maoshi.shop.distribution.comment.vo.DistributionAwardDataVO;

import java.util.List;

/**
 * @author lgh on 2019/04/01.
 */
public interface DistributionProdService extends IService<DistributionProd> {

    IPage<DistributionProd> distributionProdsPage(Page page, DistributionProd distributionProd, String prodName);

//    List<DistributionProdDto> distributionProdDtoPageDistributionUserId(Page page, Long shopId, Long distributionUserId, String prodName, Integer sort, Integer orderBy);


//    DistributionAwardDataVO getAwardDataVO(DistributionProdPO distributionProdPO, Long distributionUserId);

    /**
     * 根据获得商品id获得po对象
     *
     * @param prodId
     * @return
     */
    DistributionProdPO getDistributionProdPOByProdId(Long prodId);

    void removeDistributionProdPOCacheByProdId(Long prodId);

    /**
     * 根据分销员id获得分销商品 分页
     *
     * @param page
     * @param distributionUser
     * @return
     */
    List<DistributionProdDto> distributionProdDtoPage(Page<DistributionProdDto> page, String prodName, Integer sort, Integer orderBy, DistributionUser distributionUser);

    /**
     * 计算佣金金额
     *
     * @param distributionProdPO
     * @param distributionUserId
     * @return
     */
    DistributionAwardDataVO getAwardDataVO(DistributionProdPO distributionProdPO, Long distributionUserId);

    /**
     * 下线分销商品
     */
    void offline(DistributionProd distributionProd, String offlineReason, Long sysUserId);

    /**
     * 审核活动商品
     */
    void auditDistributionProd(OfflineHandleEventAuditParam offlineHandleEventAuditParam, Long sysUserId);

    /**
     * 提交审核
     */
    void auditApply(Long eventId, Long distributionProdId, String reapplyReason);
}
